package com.lin.pay.mall.domain.order.adapter.repository;

import com.lin.pay.mall.domain.order.model.aggregate.CreateOrderAggregate;
import com.lin.pay.mall.domain.order.model.entity.OrderEntity;
import com.lin.pay.mall.domain.order.model.entity.PayOrderEntity;
import com.lin.pay.mall.domain.order.model.entity.ProductEntity;
import com.lin.pay.mall.domain.order.model.entity.ShopCartEntity;

import java.util.List;

public interface IOrderRepository {


    /**
     * 查商品
     * @return
     */
    List<ProductEntity> queryProductList();

    /**
     * 查未支付订单
     * @param shopCartEntity
     * @return
     */
    OrderEntity queryUnPayOrder(ShopCartEntity shopCartEntity);

    /**
     * 创建支付单-更新订单状态
     * @param payOrderEntity
     */
    void updateOrderPayInfo(PayOrderEntity payOrderEntity);

    void doSaveOrder(CreateOrderAggregate orderAggregate);

    /**
     * 支付成功
     * @param orderId
     */
    void changeOrderPaySuccess(String orderId);


    List<String> queryNoPayNotifyOrder();

    /**
     * 查询超时订单
     * @return
     */
    List<String> queryTimeoutCloseOrderList();

    /**
     * 关闭超时订单
     * @param orderId
     * @return
     */
    boolean changeOrderClose(String orderId);
}
